package lol.clann.bukkit.pluginboot.util;

import lol.clann.clannboot.annotation.svc.Service;

/**
 * @author pyz
 * @date 2018/7/22 下午1:01
 */
@Service(priority = Integer.MAX_VALUE)
public class TextUtils {

    public String toDisplayColorCode(String s) {
        if (s == null) {
            return s;
        }
        return s.replace('&', '§');
    }

    public String toShowColorCode(String s) {
        if (s == null) {
            return s;
        }
        return s.replace('§', '&');
    }

    public String removeColor(String s) {
        if (s == null) {
            return s;
        }
        return s.replaceAll("&.", "").replace("§.", "");
    }

}
